const EggApiHeader = process.env.REACT_APP_API_HEADER

export const Api = {
  banner: {
    all: `${EggApiHeader}/api/banner`,
    detail: '/api/banner/detail'
  },
  homeLink: {
    all: `${EggApiHeader}/api/home-link`
  },
  studyTimeLine: {
    all: `${EggApiHeader}/api/study-time-line`
  },
  me: {
    detail: `${EggApiHeader}/api/me`
  },
  product: {
    me: `${EggApiHeader}/api/product/me`,
    detail: `${EggApiHeader}/api/product/`,
    list: `${EggApiHeader}/api/product`,
    types: `${EggApiHeader}/api/product/types`
  },
  study: {
    me: `${EggApiHeader}/api/study/me`,
    detail: `${EggApiHeader}/api/study/`,
    list: `${EggApiHeader}/api/study`,
    types: `${EggApiHeader}/api/study/types`
  },
  feedback: {
    add: `${EggApiHeader}/api/feedback`,
    list: `${EggApiHeader}/api/feedback`,
    allAuth: '/api/feedback/all-auth'
  },
  package: {
    list: `${EggApiHeader}/api/package`,
    types: `${EggApiHeader}/api/package/types`,
    detail: `${EggApiHeader}/api/package/`,
    add: '/api/package/add'
  },
  user: {
    login: `${EggApiHeader}/api/user/login`,
    sessionLogin: `${EggApiHeader}/api/user/session-login`,
    verificationCode: `${EggApiHeader}/api/user/verification-code`
  },
  csrf: `${EggApiHeader}/api/csrf`,
  server: {
    imageUp: `${EggApiHeader}/api/server/image-up`
  },
  baidu: {
    localTextIdentify: `${EggApiHeader}/api/baidu/local-text-identify`,
    urlTextIdentify: `${EggApiHeader}/api/baidu/url-text-identify`
  },
  coding: {
    base64: `${EggApiHeader}/api/coding/base64`,
    imageToBase64: `${EggApiHeader}/api/coding/image-to-base64`,
    base64ToImage: `${EggApiHeader}/api/coding/base64-to-image`,
    md5: '/api/coding/md5',
    hmac: '/api/coding/hmac',
    aes: '/api/coding/aes'
  }
}

export const Admin = {
  auth: {
    user: {
      logout: `${EggApiHeader}/admin/auth/user/logout`,
      update: `${EggApiHeader}/admin/auth/user/`,
      create: `${EggApiHeader}/admin/auth/user`,
      all: `${EggApiHeader}/admin/auth/user`,
      delete: `${EggApiHeader}/admin/auth/user/`
    },
    role: {
      create: '/admin/auth/role',
      all: '/admin/auth/role',
      update: '/admin/auth/role/',
      delete: '/admin/auth/role/'
    },
    page: {
      create: '/admin/auth/page',
      all: '/admin/auth/page',
      update: '/admin/auth/page/',
      delete: '/admin/auth/page/'
    },
    api: {
      create: '/admin/auth/api',
      all: '/admin/auth/api',
      update: '/admin/auth/api/',
      delete: '/admin/auth/api/'
    }
  },
  ali: {
    ossSgin: '/admin/ali/oss-sign',
    ossDelete: '/admin/ali/oss',
    ossList: '/admin/ali/oss/list'
  },
  banner: {
    create: '/admin/banner',
    delete: '/admin/banner/',
    update: '/admin/banner/',
    dustbinList: '/admin/banner/dustbin-list',
    dustbinRestore: '/admin/banner/dustbin-restore/',
    dustbinDelete: '/admin/banner/dustbin-delete/'
  },
  homeLink: {
    create: '/admin/home-link',
    delete: '/admin/home-link/',
    update: '/admin/home-link/',
    dustbinList: '/admin/home-link/dustbin-list',
    dustbinRestore: '/admin/home-link/dustbin-restore/',
    dustbinDelete: '/admin/home-link/dustbin-delete/'
  },
  studyTimeLine: {
    create: '/admin/study-time-line',
    delete: '/admin/study-time-line/',
    update: '/admin/study-time-line/',
    dustbinList: '/admin/study-time-line/dustbin-list',
    dustbinRestore: '/admin/study-time-line/dustbin-restore/',
    dustbinDelete: '/admin/study-time-line/dustbin-delete/'
  },
  study: {
    create: '/admin/study',
    delete: '/admin/study/',
    update: '/admin/study/',
    dustbinList: '/admin/study/dustbin-list',
    dustbinRestore: '/admin/study/dustbin-restore/',
    dustbinDelete: '/admin/study/dustbin-delete/'
  },
  me: {
    update: '/admin/me/'
  },
  feedback: {
    list: '/admin/feedback',
    delete: '/admin/feedback/',
    update: '/admin/feedback/',
    dustbinList: '/admin/feedback/dustbin-list',
    dustbinRestore: '/admin/feedback/dustbin-restore/',
    dustbinDelete: '/admin/feedback/dustbin-delete/'
  },
  product: {
    create: '/admin/product',
    delete: '/admin/product/',
    update: '/admin/product/',
    dustbinList: '/admin/product/dustbin-list',
    dustbinRestore: '/admin/product/dustbin-restore/',
    dustbinDelete: '/admin/product/dustbin-delete/'
  },
  package: {
    create: '/admin/package',
    delete: '/admin/package/',
    update: '/admin/package/',
    dustbinList: '/admin/package/dustbin-list',
    dustbinRestore: '/admin/package/dustbin-restore/',
    dustbinDelete: '/admin/package/dustbin-delete/'
  },
  ecs: {
    allFiles: '/admin/ecs/all-files',
    deleteFile: '/admin/ecs/delete-file',
    deleteAll: '/admin/ecs/delete-all'
  },
  logs: {
    web: {
      ajaxList: '/admin/logs/web-ajax',
      ajaxDelete: '/admin/logs/web-ajax/',
      processList: '/admin/logs/web-process',
      processDelete: '/admin/logs/web-process/',
      errorList: '/admin/logs/web-error',
      errorDelete: '/admin/logs/web-error/'
    },
    server: {
      processList: '/admin/logs/server-process',
      processDelete: '/admin/logs/server-process/',
      errorList: '/admin/logs/server-error',
      errorDelete: '/admin/logs/server-error/'
    }
  }
}
